package com.ruoyi.project.infobaseproject.mapper;

import com.ruoyi.project.infobaseproject.domain.InfoBaseProject;
import com.ruoyi.project.infobaseproject.vo.HomePVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;


/**
 * 项目库Mapper接口
 *
 * @author ruoyi
 * @date 2022-01-24
 */
public interface InfoBaseProjectMapper {
    /**
     * 查询项目库
     *
     * @param id 项目库主键
     * @return 项目库
     */
    public InfoBaseProject selectInfoBaseProjectById(Long id);

    /**
     * 查询项目库列表
     *
     * @param infoBaseProject 项目库
     * @return 项目库集合
     */
    public List<InfoBaseProject> selectInfoBaseProjectList(InfoBaseProject infoBaseProject);

    /**
     * 根据父项目id查询项目列表
     *
     * @param infoBaseProject
     * @return
     */
    public List<InfoBaseProject> selectInfoBaseProjectByParentId(InfoBaseProject infoBaseProject);

    /**
     * 新增项目库
     *
     * @param infoBaseProject 项目库
     * @return 结果
     */
    public int insertInfoBaseProject(InfoBaseProject infoBaseProject);

    /**
     * 修改项目库
     *
     * @param infoBaseProject 项目库
     * @return 结果
     */
    public int updateInfoBaseProject(InfoBaseProject infoBaseProject);

    /**
     * 删除项目库
     *
     * @param id 项目库主键
     * @return 结果
     */
    public int deleteInfoBaseProjectById(Long id);

    /**
     * 批量删除项目库
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteInfoBaseProjectByIds(Long[] ids);

    /**
     * 不区分父子项目查询
     *
     * @param infoBaseProject
     * @return
     */
    List<InfoBaseProject> selectInfoBaseProjects(InfoBaseProject infoBaseProject);

    Long selectInfoBaseProjectByIds(String yjxmmc);

    /**
     * 主管处室查询项目信息
     * @param infoBaseProject
     * @return
     */
    List<InfoBaseProject> selectInfoBaseProjectListByDepartmentId(InfoBaseProject infoBaseProject);

    public int deleteInfoBaseProjectByIdss(Long[] ids);

    List<InfoBaseProject> selectInfoBaseProjectLists(@Param(value = "id") Long id, @Param(value = "date") String date);

    List<InfoBaseProject> selectInfoBaseProjectByIdss(Long id);


    List<InfoBaseProject> selectInfoBaseProject(String name);

    List<InfoBaseProject> selectInfoBaseProjectss(Long yjid);

    Integer selectProject();

    Integer selectInfo();

    /**
     * 首页查询地区项目金额
     * @param deptId
     * @return
     */
    List<Map<String,Object>> selectHomeStatisticsAmount(Long deptId);

    /**
     * 查询执行数
     * @param projectId
     * @return
     */
    InfoBaseProject selectTotalFundsExecute(Long projectId);

    List<InfoBaseProject> selectInfoBaseProjectys(String name);

    /**
     *查询该一级项目下的二级项目名称
     * @param projectId
     * @return
     */
    List<Map<String,Object>> selectSecondProjectList(BigInteger projectId);

    /**
     *查询该一级项目下的二级项目名称
     * @param parentId
     * @return
     */
    List<InfoBaseProject> selectProjectDepartmentList(@Param(value = "parentId") BigInteger parentId, @Param(value = "projectName")  String projectName);

    /**
     * 批量新增项目库
     *
     * @param infoBaseProjectList 批量新增项目库
     * @return 结果
     */
     void batchInsertBaseProject(@Param("infoBaseProjectList") List<InfoBaseProject> infoBaseProjectList);

    /**
     * 查询父级项目名称
     *
     * @param projectId 查询父级项目名称
     * @return 结果
     */
    String selectParentProjectName(Long projectId);

    HomePVO selectHomePage();

    List<HomePVO> selecttypePercentage();

    List<HomePVO> selectmonthlySumAndTotal(@Param("year") String year);

    List<HomePVO> selectDeptOrs();

    List<HomePVO> selectDeptCh(@Param("deptId") String deptId);

    List<InfoBaseProject> selectInfoBaseProjectsTb(InfoBaseProject infoBaseProject);
}
